<template>
	<view>
		<cu-custom :isBack="true" bgColor="bg-white solids-bottom">
			<block slot="content">
				求购详情
			</block>
			<block slot="right">
				<text class="cuIcon-like" style="font-size: 40upx;line-height: 60upx;" ></text>
			</block>
		</cu-custom>
		
		<view class="model-main model">
			<view class="margin-bottom cu-avatar-box">
				<view class="uni-row model-item">
					<view class="uni-flex margin-bottom res">
						<view class="cu-avatar lg round margin-right" style="background-image:url(https://ossweb-img.qq.com/images/lol/web201310/skin/big25002.jpg);"></view>
						<view>
							<view class="cu-avatar-name">{{banner.CreateUserName}}</view>
							<view class="cu-avatar-num">
								<text class="margin-right-sm">{{banner.Line1Display}}</text>
								<text class="margin-right-sm">{{detail.CreateTimeDisplay}}</text>
							</view>
							<view class="cu-avatar-btn">
								<button class="cu-btn bg-red margin-tb-sm">{{banner.CreateUser.IsCollect?'取消关注':'关注'}}</button>
							</view>
						</view>
					</view>
					<view class="margin-bottom-sm">
						<view class="margin-bottom-sm solid-bottom text-xl">
							<text class="text-black text-bold">{{banner.Title}}</text>
						</view>
						<view class="margin-bottom-sm solid-bottom text-lg">
							<text class="text-black margin-right-sm">{{detail.HouseTypeDisplay}}</text>
							<text class="text-black margin-right-sm">{{detail.PriceDisplay}}</text>
							<text class="text-black margin-right-sm">{{detail.FloorAreaDisplay}}</text>
						</view>
					</view>
					<view class="uni-row model-item" style="background: #f9fcff;border: 2upx solid #e2f6fe;">
						<view class="house-detail clearfix">
							<view class="w100">
								<label class="lable"><span style="letter-spacing: 56upx;">区</span>域</label>
								<text class="text">{{detail.AreaDisplay}}</text>
							</view>
							<view class="w100">
								<label class="lable">期望小区</label>
								<text class="text">{{detail.EstateDisplay}}</text>
							</view>
							<view class="w100">
								<label class="lable">支付方式</label>
								<text class="text">{{detail.PayTypeDisplay}}</text>
							</view>
							<view class="w100">
								<label class="lable">装修情况</label>
								<text class="text">{{detail.FitmentTypeDisplay}}</text>
							</view>
							<view class="w100">
								<label class="lable"><span style="letter-spacing: 56upx;">朝</span>向</label>
								<text class="text">{{detail.OrientationTypeDisplay}}</text>
							</view>
							<view class="w100">
								<label class="lable"><span style="letter-spacing: 56upx;">楼</span>龄</label>
								<text class="text">{{detail.BuildYearDisplay}}</text>
							</view>
							<view class="w100">
								<label class="lable"><span style="letter-spacing: 56upx;">楼</span>层</label>
								<text class="text">{{detail.FloorsDisplay}}</text>
							</view>
						</view>
					</view>
				</view>
			</view>
		</view>
		<view class="warp120" style="background: #FFFFFF;"></view>
		<view class="calltool cu-bar shadow foot tabbar">
			<view class="callbtn">
				<navigator url="#" class="cu-avatar-box">
					<view class="uni-flex">
						<view class="cu-avatar round margin-right-sm" style="background-image:url(https://ossweb-img.qq.com/images/lol/web201310/skin/big25002.jpg);"></view>
						<view style="flex: 1;">
							<view class="cu-avatar-name">{{banner.CreateUserName}}</view>
							<view class="cu-avatar-num">
								{{detail.CreateUser.AgencyName==''?'个人':detail.CreateUser.AgencyName}}
							</view>
						</view>
					</view>
				</navigator>
			</view>
			<view class="toolbtn" style="background: #941b0c;">
				<view class="iconfont">&#xe788;</view>
				<view>私信</view>
			</view>
			<view class="toolbtn" style="background: #bc3908;">
				<view class="iconfont">&#xe6c7;</view>
				<view>电话</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				banner:{},
				detail:{},
			}
		},
		onLoad:function(event){
			try {
				this.banner = JSON.parse(decodeURIComponent(event.detailDate));
			} catch (error) {
				this.banner = JSON.parse(event.detailDate);
			}
			console.info(this.banner);
			this.getBuyDetail();
		},
		onReachBottom() {
		},
		mounted(){
	    },
		methods: {
			getBuyDetail:function(){
				console.info("start BuyDetail");
				let _this = this;
				let data = {id:this.banner.Id};
				uni.request({
					url: this.AjaxUrl + '/WebApi/GetX3HouseToBuyDetail',
					data:data,
					success: (res) => {
						if (res.statusCode == 200) {
							_this.detail = JSON.parse(res.data.Extend);
							console.info(_this.detail);
						}
					},
					fail: () => {
						console.info('请求失败');
					},
				});
			}
		}
	}
</script>

<style lang="less">
	.res{
		position: relative;
	}
	.house-detail{
		.w100,.w50{
			float: left;
			width: 100%;
			display: flex;
			margin-bottom: 10upx;
			.lable{
				display: inline-block;
				padding-right: 10upx;
				color: #999999;
				box-sizing: content-box;
			}
			.text{
				flex: 1;
				padding-left: 10upx;
			}
		}
		.w50{
			width: 50%;
			&.right{
				.lable{
					width: 112upx
				}
			}
		}
	}
	.cu-avatar-box{
		.uni-row.model-item{
			padding: 30upx;
			overflow: hidden;
			.cu-avatar-name{
				font-size: 32upx;
				color: #333333;
				line-height: 48upx;
			}
			.cu-avatar-num{
				text{
					font-size: 24upx;
					color: #999999;
					line-height: 48upx;
				}
			}
			.cu-avatar-btn{
				position: absolute;
				right: 0;
				bottom: 0;
			}
		}
	}
	.calltool{
		display:flex;
		background: #FFFFFF;
		height: 100upx;
		.callbtn{
			width:310upx;
			height: 100upx;
			text-align: left;
			padding: 10upx 0;
			box-sizing: border-box;
			.cu-avatar-name,.cu-avatar-num{
				line-height: 40upx;
				font-size: 28upx;
				
			}
			.cu-avatar-num{
				font-size: 24upx;
			}
		}
		.toolbtn{
			flex: 1;
			text-align: center;
			height: 100upx;
			padding: 10upx 0;
			color: #FFFFFF;
			.iconfont{
				font-size: 40upx;
				color: #FFFFFF;
				line-height: 1;
			}
		}
	}
	
</style>
